package com.edu.test;

import com.edu.bean.User;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest03 {

    ApplicationContext context;

    @Before
    public void init(){
        context = new ClassPathXmlApplicationContext("spring-ioc3.xml");
    }

    @Test
    public void test01(){
//        Object a = context.getBean("a");
//        Object b = context.getBean("b");
//        System.out.println(a);
//        System.out.println(b);
        Object o1 = context.getBean("user");
        Object o2 = context.getBean("user");
        System.out.println(o1 == o2);
        context.close();
    }





}
